# -*- coding: utf-8 -*-
"""
@Time    : 2024/7/17 19:20 
@Author  : ZhangShenao 
@File    : scatter.py 
@Desc    : 使用Matplotlib库,绘制散点图
"""

import matplotlib.pyplot as plt

# 准备数据点
team_a_score = [10, 15, 20, 12, 17, 10, 30, 35, 18, 4]
team_b_score = [25, 11, 21, 32, 22, 32, 12, 5, 3, 25]
score_range = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

# 初始化图像对象
fig = plt.figure()

# 初始化绘图区域
ax = fig.add_axes([0, 0, 1, 1])

# 绘制散点图
ax.scatter(score_range, team_a_score, color='y', label="Team-A score")
ax.scatter(score_range, team_b_score, color='b', label="Team-B score")

# 设置x轴的表达含义
ax.set_xlabel('Score Range')
# 设置Y轴的表达含义
ax.set_ylabel('Score of Team')
# 设置图标题
ax.set_title('Team Score Scatter Plot')

# 设置图例
plt.legend()

# 展示图像
plt.show()
